package com.chuji.crmcj.fragment;

import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;

import com.chuji.crmcj.R;
import com.chuji.crmcj.act.MainActivity;
import com.chuji.crmcj.act.NoticeDetailActivity;
import com.chuji.crmcj.utils.Jump;
import com.readystatesoftware.viewbadger.BadgeView;

public class FollowTableFragment extends Fragment {
    /*通知布局*/
    private ListView lv_follow_table;
    /*自定义适配器*/
    private CustomTableAdapter customTableAdapter;

    private Context context;
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view=inflater.inflate(R.layout.fragment_follow_table, container, false);
        lv_follow_table= (ListView)view.findViewById(R.id.lv_follow_table);
        //创建适配器
        customTableAdapter = new CustomTableAdapter();
        //填充数据
        lv_follow_table.setAdapter(customTableAdapter);
        //5)给ListView设置点击事件
        lv_follow_table.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view,
                                    int position, long id) {
//                UIUtils.showToastSafe("点击了第"+position+"个Item");
//                Jump.toNextActivity(NoticeActivity.this, NoticeDetailActivity.class);
            }
        });
        return view;

    }
    //初始化组件
    private void init() {

    }
    class CustomTableAdapter extends BaseAdapter {

        @Override
        public int getCount() {
            return 4;
        }

        @Override
        public Object getItem(int position) {
            return null;
        }

        @Override
        public long getItemId(int position) {
            return position;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup viewGroup) {

            convertView = LayoutInflater.from(context).inflate(R.layout.listview_follow_up_table, null);

            return convertView;
        }
    }
}
